<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script>
var a = 10;
/*
    所有全局变量都会成为 window 的一个属性
    
    
 */
console.log(a);
console.log(window.a);

function foo(){
    console.log(this.a);
}
foo();

window.foo()
</script>
</body>
</html>